package com.neulogistics.contrib.warehouse.api.application.query;


import com.neulogistics.contrib.warehouse.api.application.validator.annotation.InList;
import com.neulogistics.contrib.warehouse.api.application.validator.annotation.ValidateAddress;
import com.neulogistics.contrib.warehouse.domain.model.valueobject.Address;
import lombok.Data;

import javax.validation.constraints.Max;
import javax.validation.constraints.Positive;
import javax.validation.constraints.Size;
import java.io.Serializable;


@Data
public class WarehouseQuery implements Serializable {
    private static final long serialVersionUID = 1L;

    /**
     * 当前页号
     */
    @Positive(message = "当前页数非法！")
    private long pageNum = 1;

    /**
     * 页面大小
     */
    @Positive
    @Max(value = 20, message = "请求数据过多！")
    private long pageSize = 10;

    /**
     * 库房名
     */
    @Size(max = 20, message = "非法的库房名")
    private String warehouseName;

    /**
     * 库房地址{省，市，区，详细}
     */
    @ValidateAddress
    private Address warehouseAddress;

    /**
     * 库房等级：0：中心库房；1：分站库房
     */
    @InList(values = {-1, 0, 1})
    private Integer warehouseLevel;
}
